import { request } from '../service'
import IBaseObj from '#/index'
import { AxiosProgressEvent } from 'axios'

const getDicom = (vid: number | string) =>
  request({
    url: `/edc/dicom/visit/${vid}`,
    method: 'GET',
  })

export const uploadDicomZip = (
  data: IBaseObj,
  onUploadProgress: (progressEvent: AxiosProgressEvent) => void
) =>
  request({
    url: `/edc/upload/dicom`,
    method: 'post',
    timeout: 1000000,
    data,
    onUploadProgress,
  })

export default {
  getDicom,
  uploadDicomZip,
}
